home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / prog / gnu-c / geninline / readme.glue < prev    next >
Text File  |  1993-11-01  |  2KB  |  62 lines

  1. To generate glue functions to build a small (but free;-)) version of 
  2. libamiga.a, two files are involved:
  3.  
  4.   - template.c
  5.   - genglue.p
  6.  
  7. template.c really is my test file for inline headers, I just found it to
  8. be useful for this purpose as well. If you look at it, you see that it 
  9. includes all available inline headers, along with their CBM proto headers
  10. (which are not included in this distribution, because they are copyrighted
  11. by CBM). You need the clib/ files only, if you want to test inline headers
  12. (whether the automatically generated parameters match the declarations in
  13. the official headers). If you only want to regenerate libamy.a, just remove
  14. them.
  15.  
  16. Since all headers are included at once, you might get memory problems if
  17. you don't have enough real (or virtual;-)) memory. In that case just split
  18. the file into multiple, smaller parts. Isolating inclusion of large inline
  19. headers might be a good idea, so you might consider isolating dos.h, 
  20. graphics.h. Just keep in mind to add
  21.  
  22.   #define static
  23.   #define __inline
  24.  
  25. all your own templates, so that the functions really are compiled;-)
  26.  
  27. Here's, step by step, what I did to generate the two libraries, blib/libamy.a
  28. and lib/libamy.a:
  29.  
  30.   MakeDir normal-s
  31.   MakeDir baserel-s
  32.   
  33.   gcc -O2 -S template.c        ; this leaves a template.s file
  34.   gcc -O2 -S -fbaserel template.c -o template.bs    ; leaves template.bs
  35.  
  36.   cd normal-s
  37.   perl ../genglue.p < /template.s    ; may take a LONG time!
  38.   gcc -c *.s                ; ""
  39.   ar q libamy.a *.o            ; ""
  40.   cd /baserel-s
  41.   perl ../genglue.p < /template.bs    ; ""
  42.   gcc -c *.s                ; ""
  43.   ar q libamy.a *.o            ; ""
  44.   cd /
  45.   
  46. You now have normal-s/libamy.a which is a small, not a4-relative libamiga.a,
  47. and baserel-s/libamy.a, which is base (ie. a4) relative.
  48.  
  49. The above warnings, that those commands may take a LONG time, are for real.
  50. All of them have to deal with roughly 800 assembler rsp. object files, just
  51. the time to create those files (thus not counted the time needed to process
  52. them) is quite noticeable... But as long as you see your harddisk working,
  53. everything should procede as expected ;-)
  54.  
  55. Good luck!
  56.  
  57. -Markus
  58.  
  59. BTW: oh, and don't forget that you don't *have* to do this step yourself,
  60. both libamy.a are included in this distribution. You'll only need to walk
  61. thru these steps if you get a newer AmigaOS release some day ;-)
  62.